home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Examples / support / fork.wwModel / model.eve
Encoding:
Text File  |  1995-03-22  |  1.7 KB  |  52 lines

  1. set fork(color) {1 0 0}
  2. set fork(halfWidth) 2
  3. set fork(radius) 1
  4. set fork(cylinderLength) 3
  5.  
  6. set fork(volumePreservingScaleFactor) 1.0
  7.  
  8. EveCmd {set fork(xScale) [expr 1./sqrt($fork(volumePreservingScaleFactor))]}
  9. EveCmd {set fork(yScale) $fork(volumePreservingScaleFactor)}
  10. EveCmd {set fork(zScale) [expr 1./sqrt($fork(volumePreservingScaleFactor))]}
  11.  
  12. loadControlPanel controls.nib
  13.  
  14. startShape Fork
  15.     EveCmd {Color $fork(color)}
  16.     EveCmd {Scale $fork(xScale) $fork(yScale) $fork(zScale)}
  17.     SolidBegin primitive
  18.       # the torus
  19.       EveCmd {Torus $fork(halfWidth) $fork(radius) 0 360 180}
  20.  
  21.         #left (from its pov) disk
  22.           # translate the disk by $torus(majorRadius)
  23.       TransformBegin        
  24.           EveCmd {Translate $fork(halfWidth) 0 0 }
  25.         Rotate 90 1 0 0
  26.         EveCmd {Cylinder $fork(radius) 0 $fork(cylinderLength) 360}
  27.       TransformEnd
  28.       TransformBegin
  29.           EveCmd {Translate $fork(halfWidth) 0 0 }
  30.         Rotate 90 1 0 0
  31.             # Make the height of the disk == the zMax of the cylinder and the radius equal to the cylinder's
  32.         EveCmd {Disk $fork(cylinderLength) $fork(radius) 360}
  33.        TransformEnd
  34.  
  35.         #right (from its pov) disk
  36.           # translate the disk by $torus(majorRadius)
  37.       TransformBegin        
  38.           EveCmd {Translate [expr {-1 * $fork(halfWidth)}] 0 0 }
  39.         Rotate 90 1 0 0
  40.         EveCmd {Cylinder $fork(radius) 0 $fork(cylinderLength) 360}
  41.       TransformEnd
  42.       TransformBegin
  43.           EveCmd {Translate [expr {-1 * $fork(halfWidth)}] 0 0 }
  44.         Rotate 90 1 0 0
  45.             # Make the height of the disk == the zMax of the cylinder and the radius equal to the cylinder's
  46.         EveCmd {Disk $fork(cylinderLength) $fork(radius) 360}
  47.        TransformEnd
  48.     SolidEnd
  49. endShape
  50.  
  51.  
  52.